import React from 'react';
import IconFont from '@/components/IconFont';
import styles from './index.less';

// 邮件附件组件
const Attachment = ({ attachmentList }) => (
    <div className={styles.attachmentWrap}>
        {attachmentList.length > 0 &&
            attachmentList.map(item => (
                <div className={styles.box} key={item.keyName || item.originName}>
                    <IconFont icon="iconfujian" />
                    <ul>
                        <a href={item.url} download={item.originName} alt="download">
                            <li>
                                <span className={styles.title}> 附件：</span>
                                {item.originName}
                            </li>
                            <span className={styles.iconCtr}>
                                <IconFont icon="iconxiazai" />
                            </span>
                        </a>
                    </ul>
                </div>
            ))}
    </div>
);
export default Attachment;
